﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProjectStudent
{
    public partial class MainFrame : Form
    {
        public MainFrame()
        {
            InitializeComponent();
        }

        private void showFormInPanel2(Form form)
        {
            form.TopLevel = false;
            form.FormBorderStyle = FormBorderStyle.None;
            form.Dock = DockStyle.Fill;
            this.Controls.Add(form);
            splitContainer1.Panel2.Controls.Add(form);
            form.Show();

        }

        private void showUserControl()
        {

        }
        private void btnUserMange_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();


            UserManage form2 = new UserManage();
            showFormInPanel2(form2);
            //form2.TopLevel = false;
            //form2.FormBorderStyle = FormBorderStyle.None;
            //form2.Dock = DockStyle.Fill;
            //this.Controls.Add(form2);
            //splitContainer1.Panel2.Controls.Add(form2);
            //form2.Show();


            //splitContainer1.Panel2.Controls.Clear();
            //UserControl1 form2 = new UserControl1();
            //form2.Dock = DockStyle.Fill;
            //this.Controls.Add(form2);
            //splitContainer1.Panel2.Controls.Add(form2);
            //form2.Show();


        }

        private void btnStudentManage_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            StudentManage form = new StudentManage();
            showFormInPanel2(form);
        }

        private void btnClassManage_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            ClassManager form = new ClassManager();
            showFormInPanel2(form);
        }

        private void btnScoreManage_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            ScoresManage form = new ScoresManage();
            showFormInPanel2(form);
        }
    }
}
